#pragma once

#include <QList>
#include <QObject>
#include <QPointF>
#include <cmath>

#include "QNode.h"

class QAbstractMuscle: public QObject
{
    Q_OBJECT
private:

protected:
    int id;
    int type;
    QPointF centerPos;

    double defL, l, f, k;
    QList <QNode*> nList;

    double memPot;
    double tempMemPot;

public:
    QAbstractMuscle(void);

    int getID(void);
    int getType(void);
    double getDefL(void);
    double getK(void);

    virtual void calculateForce(void) = 0;
    void calculateCenterPos(void);
    QPointF getCenterPos(void);

    QList<QNode*> getNodeList(void);

public slots:
    void setID(int _id);
    void setDefL(double _defL);
    void setK(double _k);

    void setMemPot(double _memPot);
    void addMemPot(double _memPot);
    void rotMemPot(void);

    void addNode(QNode *node);
    void sendForce(void);
    void emitEverything(void);

signals:
    void idChanged(int);
    void defLChanged(double);
    void kChanged(double);

    void memPotChanged(double);

};
